#!/usr/bin/perl -w
use Statistics::Descriptive;

my $stat1 = Statistics::Descriptive::Full->new();
while ( <stdin> ) {
    $stat1->add_data($_);
}

my $w=$ARGV[0];
my @bins=();
for ($i=0;$i<10;$i++) {
#    push @bins,($w*$i) + ($w/2);
    push @bins,($w*$i);
}    

my %f = $stat1->frequency_distribution(\@bins);
my $n = $stat1->count;
for (sort {$a <=> $b} keys %f) {
    printf "%f %f\n",$_,$f{$_}*100/$n;
}
